package com.hub.realtime.resource.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hub.realtime.common.annotation.Excel;
import com.hub.realtime.common.core.domain.BaseEntity;
import lombok.Data;

/**
 * 作业管理中心对象 res_flink_job
 *
 * @author wupeng
 * @date 2022-01-18
 */
@TableName("res_flink_job")
@Data
public class ResFlinkJob extends BaseEntity<ResFlinkJob>
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @TableId(value="id", type= IdType.AUTO)
    private Long id;

    /** 所属项目ID */
    @TableField("application_id")
    @Excel(name = "所属项目ID")
    private Long applicationId;

    /** 作业名称 */
    @TableField("job_name")
    @Excel(name = "作业名称")
    private String jobName;

    /** 作业类型（sql|flink） */
    @TableField("job_type")
    @Excel(name = "作业类型", readConverterExp = "sql|flink")
    private String jobType;

    /** 发布模式(yarn-application|yarn-per-job|k8s-session|k8s-application） */
    @TableField("deploy_model")
    @Excel(name = "发布模式(yarn-application|yarn-per-job|k8s-session|k8s-application）")
    private String deployModel;

    /** 当前的flink版本 */
    @TableField("flink_version")
    @Excel(name = "当前的flink版本")
    private String flinkVersion;

    /** 作业状态 */
    @TableField("job_state")
    @Excel(name = "作业状态")
    private Integer jobState;

    /** 开始时间 */
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 结束时间 */
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 创建人Id */
    @TableField("user_id")
    @Excel(name = "创建人Id")
    private Long userId;

    /** 上一次提交日期 */
    @TableField("last_submit_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上一次提交日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastSubmitTime;

    /** 上一次取消日期 */
    @TableField("last_cancel_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上一次取消日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastCancelTime;

    /** yarn生成的任务ID */
    @TableField("yarn_id")
    @Excel(name = "yarn生成的任务ID")
    private String yarnId;

    /** flink 任务ID */
    @TableField("flink_job_id")
    @Excel(name = "flink 任务ID")
    private String flinkJobId;

    /** flink web页面地址 */
    @TableField("flink_web_url")
    @Excel(name = "flink web页面地址")
    private String flinkWebUrl;

    /** flink监控地址 */
    @TableField("flink_monitor")
    @Excel(name = "flink监控地址")
    private String flinkMonitor;

    /** 随机code */
    @TableField("uid")
    @Excel(name = "随机code")
    private String uid;

    /** 关联的flink task id */
    @TableField("task_id")
    @Excel(name = "关联的flink task id")
    private Long taskId;

    /** 关联的sql id */
    @TableField("sql_id")
    @Excel(name = "关联的sql id")
    private Long sqlId;

    @TableField("lunch_time")
    private String lunchTime;


    @TableField("deploy_state")
    private Integer deployState;

    /**
     * 用于前端显示项目名称
     */
    @TableField(exist = false)
    private String applicationName;



    @TableField(exist = false)
    private String jobManagerMB;

    @TableField(exist = false)
    private String taskManagerMB;

    @TableField(exist = false)
    private String jobManagerCpuCore;

    @TableField(exist = false)
    private String taskManagerCpuCore;

    @TableField(exist = false)
    private String totalCpuCore;

    @TableField(exist = false)
    private String totalMB;

    @TableField(exist = false)
    private Integer parallelism;



}
